const Crawler = require('../libs/crawler'),
      { crawler }  = require('../config/config');

//爬取轮播图
Crawler({
    url: crawler.url.main,
    callback () {
        const $ = window.$,
              $item = $('.agency-big-banner-ul .agency-big-banner-li');

        const data = [];

        $item.each((index, item) => {
            const $el = $(item),
                  $elLink = $el.find('.js-banner-btnqq');

            const dataItem = {
                  cid: $elLink.attr('data-id'),
                  href: $elLink.prop('href'),
                  title: $elLink.prop('title'),
                  imgUrl: $elLink.find('img').prop('src'),
                  imgKey: '',//因为我们之后要给图片另起名称，所以这个imgKey要为空才行
            }

            data.push(dataItem);
        })

        return data;
    }
});